package ch2;

import java.util.Scanner;

public class JavaClassTest {

	public static void main(String[] args) {
		// 测试班级
		Scanner in = new Scanner(System.in);
		JavaClass jc = new JavaClass();
		jc.name = "hlwjgs61";
		jc.beginDate = "2019-5-6";
		jc.dirTeacher = "Miss 孔";
		jc.techTeacher = "old Liu";
		int choice = 0;
		while (true) {
			System.out.println("1:查看班级信息，2：添新同学，3：查找同学，4:按照範圍查找學生.9：退出");
			choice = in.nextInt();
			if (choice == 1) {
				// System.out.println(jc.name + "," + jc.dirTeacher);
				jc.showInfo();
			} else if (choice == 2) {
				System.out.println("新同学的名字：");
				String newStu = in.next();
				jc.add(newStu);
			} else if (choice == 3) {
				System.out.println("找谁？");
				String sname = in.next();
				boolean exist = jc.search(sname);
				if (exist) {
					System.out.println(sname + "在" + jc.name);
				} else {
					System.out.println("没找到");
				}
			} else if (choice == 4) {

			} else if (choice == 9) {
				break;
			}
		}
	}

}
